package com.yjd.comm.funds.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 未接入存管之前的充值枚举
 * Created by yangchangyan on 2017/6/8.
 */
public enum OriginRechChannel {

    PC(1, "PayAuth", "/recharge/pageUrl", "pc"),
    ANDROID(2, "PayAuthWap", "/recharge/pageUrl", "android"),
    IOS(3, "PayAuthWap", "/recharge/pageUrl", "ios"),
    WAP(4, "PayAuthWap", "/recharge/wapUrl", "wap");

    private int code;
    private String appType;
    private String pageUrl;
    private String lable;

    private OriginRechChannel(int code, String appType, String pageUrl, String lable) {
        this.code = code;
        this.appType = appType;
        this.pageUrl = pageUrl;
        this.lable = lable;
    }

    public static OriginRechChannel getChannel(String lable) {
        OriginRechChannel[] channels = OriginRechChannel.values();
        for (OriginRechChannel c : channels) {
            if (StringUtils.isNotBlank(lable)
                    && lable.equalsIgnoreCase(c.getLable())) {
                return c;
            }
        }
        return OriginRechChannel.PC;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getLable() {
        return lable;
    }

    public void setLable(String lable) {
        this.lable = lable;
    }

    public String getAppType() {
        return appType;
    }

    public void setAppType(String appType) {
        this.appType = appType;
    }

    public String getPageUrl() {
        return pageUrl;
    }

    public void setPageUrl(String pageUrl) {
        this.pageUrl = pageUrl;
    }
}
